import request from '@/utils/request'

export function getSubjectTags(params) {
  return request({
    url: '/subject/tag',
    params
  })
}
export function updateStatus(data) { // 修改标签状态
  return request({
    url: `/subject/tag/${data.id}`,
    method: 'PUT',
    data
  })
}
export function delSubjectTag(id) { // 删除标签状态
  return request({
    url: `/subject/tag/${id}`,
    method: 'DELETE'
  })
}
export function getSubjectTree() { // 获取学科树
  return request({
    url: 'subject/tree'
  })
}
export function addSubjectTags(data) { // 添加标签
  return request({
    url: '/subject/tag',
    method: 'POST',
    data
  })
}
export function getSubject(id) { // 编辑标签
  return request({
    url: `/subject/tag/${id}`
  })
}
export function editSubject(data) {
  return request({
    url: `/subject/tag/${data.id}`,
    method: 'PUT',
    data
  })
}

export function uploadImg(data) {
  return request({
    url: '/index/upload?mode=base64&type=image',
    method: 'POST',
    data
  })
}
